#pragma once
#ifdef WIN32
#pragma execution_character_set("utf-8")  
#endif

#include <QWidget>
#include <QPainter>
#include <QMouseEvent>

#include "NewsCellData.h"
#include "ui_NewsCellWidget.h"

QT_BEGIN_NAMESPACE
namespace Ui { class NewsCellWidgetClass; };
QT_END_NAMESPACE

class NewsCellWidget : public QWidget
{
	Q_OBJECT

public:
	NewsCellWidget(QWidget *parent = nullptr);
	~NewsCellWidget();
	void setUi(const NewsCellData& newsCellData);
private:
	Ui::NewsCellWidgetClass *ui;


private:
	NewsCellData m_newsCellData;

public:
	NewsCellData newsCellData() const
	{
		return m_newsCellData;
	}

private:
	virtual void mouseReleaseEvent(QMouseEvent* event) override;
	virtual void paintEvent(QPaintEvent* event) override;

signals:
	void on_newsCell_click(NewsCellWidget* cellWidget);
};